#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;

long Fast_Power_Multiplication_NonR(long x, long n)
{
	if (x == 0)
		return 0;
	long am = 1;
	while (n > 0)
	{
		if (n % 2)
		{
			am *= x;
		}
		x *= x;
		n /= 2;
	}
	return am;
}
int main()
{
	long x, n;
	cout << "Please enter the value of x and n:>";
	cin >> x >> n;
	cout << Fast_Power_Multiplication_NonR(x, n) << endl;
	return 0;
}